package com.zhengwl.study.aop;

import java.lang.reflect.Method;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

public class LogIntercept implements MethodInterceptor {

	public Object intercept(Object target, Method method, Object[] args, MethodProxy proxy) throws Throwable {
		Object rev = proxy.invokeSuper(target, args); // 执行织入的日志
		if (method.getName().equals("doWork")) {
			System.out.println("记录日志");
		}
		return rev;
	}

}
